/// @tags:
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <queue>

namespace BlueQuantum {

int const N = 6e5 + 5, P = 998244353;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

int n, sum, maxl = 1, max;
int f[N], g[N], popcnt[N];

inline int mod(int a) {
  int res = a;
  if (res >= P) res -= P;
  if (res < 0) res += P;
  return res;
}

inline void FWT() {
  for (int i = 2; i <= maxl; i <<= 1) {
    int mid = i >> 1;
    for (int j = 0; j < maxl; j += i) {
      for (int k = 0; k < mid; ++k) {
        int tmp = f[j + k];
        f[j + k] = f[j + k] + f[j + k + mid] >= P ? f[j + k] + f[j + k + mid] - P
                                                  : f[j + k] + f[j + k + mid];
        f[j + k + mid] =
            tmp - f[j + k + mid] < 0 ? tmp - f[j + k + mid] + P : tmp - f[j + k + mid];
      }
    }
  }
}

inline int main() {
  read(n);
  for (int i = 0, a; i < n; ++i) sum ^= read(a), ++f[a], max = std::max(max, a);
  if (!sum) return printf("%d", n), 0;
  while (maxl < max) maxl <<= 1;
  FWT();
  for (int i = 1; i <= maxl; ++i) popcnt[i] = popcnt[i >> 1] + (i & 1);
  for (int i = 0; i < maxl; ++i) g[i] = 1;
  for (int i = 1; true; ++i) {
    int ans = 0;
    for (int j = 0; j < maxl; ++j) {
      g[j] = 1ll * g[j] * f[j] % P;
      (ans += (popcnt[sum & j] & 1) ? -g[j] + P : g[j]), ans %= P;
    }
    if (ans) return printf("%d", n - i), 0;
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("nim.in", "r", stdin);
  freopen("nim.out", "w", stdout);
#endif
#endif

  return BlueQuantum::main();
}